#基础镜像，用官方的Python 3.9
FROM python:3.9
#将项目目录文件复制到镜像中,CODE_DIR是在基础镜像中定义的
RUN mkdir -p /GreaterWMS/templates
COPY ..  /GreaterWMS
#配置工作目录
WORKDIR /GreaterWMS
#安装supervisor
#更换apt-get为阿里云的源
#RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list
RUN sed -i s/deb.debian.org/mirrors.163.com/g /etc/apt/sources.list
RUN apt-get clean
RUN apt-get update && apt-get upgrade -y
RUN apt-get install build-essential -y
RUN apt-get install supervisor -y
RUN python -m pip install --upgrade pip -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
#安装supervisor
#安装项目依赖包
RUN pip install supervisor -i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com
RUN pip install -U 'Twisted[tls,http2]' -i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com
RUN pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com
RUN pip install --upgrade numpy -i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com
EXPOSE 8008
#CMD ["daphne","-b","0.0.0.0","-p","8008","greaterwms.asgi:application"]
